package com.sitechasia.webx.components.xtable.toolbar;

import org.extremecomponents.table.core.TableModel;
import org.extremecomponents.util.HtmlBuilder;

/**
 *
 * @author Administrator
 *
 */
public abstract class DivLayout {
	private HtmlBuilder html;

	private TableModel model;

	public DivLayout(HtmlBuilder html, TableModel model) {
		this.html = html;
		this.model = model;
	}

	protected HtmlBuilder getHtmlBuilder() {
		return html;
	}

	protected TableModel getTableModel() {
		return model;
	}

	public void layout() {
		if (!showLayout(model)) {
			return;
		}

		divToolbar(html, model);

	}

	public String toString() {
		return html.toString();
	}

	protected abstract boolean showLayout(TableModel model);

	protected abstract void divToolbar(HtmlBuilder html, TableModel model);
}
